<?php

namespace App\Http\Controllers\View\Front;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Facades\Services\AddressService;
use App\Facades\Services\CaseService;

class CaseController extends Controller
{
    public function index(Request $request)
    {
    	$jianZhongCases = CaseService::getCaseFrontByJianZhong($request);

    	$tangNiaoBingCases = CaseService::getCaseFrontByTangNiaoBing($request);

        // dd($jianZhongCases->toArray());

        return view('pages.front.case_list',[
        		'provinces' => AddressService::getAllProvince(),
        		'jianZhongCases' => $jianZhongCases,
        		'tangNiaoBingCases' => $tangNiaoBingCases,
        		'request' => $request->all()
        	]);
    }

    public function details(Request $request){

    	$case = CaseService::getById($request);

    	return view('pages.front.details',[
    		'case' => $case
    	]);
    }
}
